/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.bs.analisis.plugin.lifecycle;

import java.util.Date;

/**
 *
 * @author gbran
 *
 * PluginEvent es el DTO para eventos CDI de plugin utilizado por la aplicacion.
 *
 * Este wrapper se utiliza para disparar eventos de Activacion y Desactivacion de
 * plugins.
 * 
 * Los eventos Deploy y OnUndeploy son interceptados por las anotaciones 
 * <code>OnDeploy</code> y <code>OnUndeploy</code> respectivamente, por lo que
 * no debe utilizar esta clase para dispararlos.
 * 
 */
public class PluginEvent implements java.io.Serializable {

    private String comments;
    private Date datetime;
    private Event event;

    public PluginEvent() {
    }

    public PluginEvent(String comments, Event event) {
        this.datetime = new Date();
        this.comments = comments;
        this.event = event;
    }

    public enum Event {

        ACTIVATE, DEACTIVATE
    }

    public Event getEvent() {
        return this.event;
    }

    public void setEvent(Event event) {
        this.event = event;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public Date getDatetime() {
        return datetime;
    }

    public void setDatetime(Date datetime) {
        this.datetime = datetime;
    }
}
